package com.codes.service.impl;

import com.codes.dao.OrderInfoWMMapper;
import com.codes.model.OrderInfoWM;
import com.codes.service.OrderInfoWMSV;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Date 2020/6/18 11:27
 * @Created by peanut
 */
@Service
public class OrderInfoWMImpl implements OrderInfoWMSV {

    @Autowired
    private OrderInfoWMMapper orderInfoWMMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return orderInfoWMMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(OrderInfoWM record) {
        return 0;
    }

    @Override
    public int insertSelective(Map m) {
        return orderInfoWMMapper.insertSelective(m);
    }

    @Override
    public OrderInfoWM selectByPrimaryKey(Integer id) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(Map map) {
        return orderInfoWMMapper.updateByPrimaryKeySelective(map);
    }

    @Override
    public int updateByPrimaryKey(OrderInfoWM record) {
        return 0;
    }

    @Override
    public List<Map<String, Object>> getListByOrderId(Map map) {
        return orderInfoWMMapper.getListByOrderId(map);
    }


    @Override
    public List<Map<String, Object>> getListToPageExport(Map map) {
        return orderInfoWMMapper.getListToPageExport(map);
    }

    @Override
    public int deleteBatch(List<String> ids) {
        int re = 0;
        Integer orderInfoWMId;
        for (String id:ids             ) {
            orderInfoWMId = Integer.parseInt(id);
            if(null != orderInfoWMId){
              re =   orderInfoWMMapper.deleteByPrimaryKey(orderInfoWMId);
            }
        }
        return re;
    }
}